package org.xdq.test;

public class MyObject {



    public static class Builder{
        private String id;
        private String name;
        private int num;
        private String info;
        private double score;

        public Builder(String id, String name) {
            this.id = id;
            this.name = name;
        }

        public Builder setNum(int num) {
            this.num = num;
            return this;
        }

        public Builder setInfo(String info) {
            this.info = info;
            return this;
        }

        public Builder setScore(double score) {
            this.score = score;
            return this;
        }

        public MyObject build(){
            return new MyObject(this);
        }
    }

    private String id;
    private String name;
    private int num;
    private String info;
    private double score;

    private MyObject(Builder builder) {
        this.id = builder.id;
        this.name= builder.name;
        this.num=builder.num;
        this.info = builder.info;
        this.score = builder.score;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public int getNum() {
        return num;
    }

    public String getInfo() {
        return info;
    }

    public double getScore() {
        return score;
    }
}
